<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.5,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 设置苹果工具栏颜色 -->
    <meta name="format-detection" content="telphone=no, email=no" />
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
    <meta name="HandheldFriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="MobileOptimized" content="320">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <!-- QQ强制全屏 -->
    <meta name="x5-fullscreen" content="true">
    <!-- UC应用模式 -->
    <meta name="browsermode" content="application">
    <!-- QQ应用模式 -->
    <meta name="x5-page-mode" content="app">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>虾客云-客户管理</title>
    <link rel="stylesheet" href="{{asset('css/reset.css')}}">
    <link rel="stylesheet" href="{{asset('css/main.css')}}">
    <link rel="stylesheet" href="{{asset('css/index.css')}}">
    <link rel="stylesheet" href="{{asset('css/yd_rl.css')}}" />
    <link rel="stylesheet" href="{{asset('css/LCalendar.css')}}" />
</head>
<body>
    <!-- 公共头部 -->
    <div class="g2_head-bg">
        <!-- 返回上一层 -->
        <p class="g2_head_goback-bg fl">
            <a href="javascript:history.back(-1)">
                <img src="{{asset('images/xky_icon0-1.png')}}" class="g2_head_goback_icon fl" alt="">
                <span class="g2_head_goback_del fl">返回</span>
            </a>
        </p>
        <p class="ym-tit fl">客户关怀</p>
        <div class="cl"></div>
    </div>
    <div class="g2_head-bg2"></div>
    <!-- 客户管理  客户关怀列表 -->
    <div class="khgl_khghlb-bg" id="khghlb1">
        @foreach($customer as $vo)
        <div class="cjd_khgllb-bg">
            <p class="khghlb_khname fl">{{$vo->customer_name}}</p>
            <p class="khghlb_iphone fl">{{$vo->customer_phone}}</p>
            <input type="button" id="shengri" class="khghlb_btn fr" value="生日提醒">
            <input type="hidden" name="id" value="{{$vo->id}}">
            <p class="khghlb_gs fl">{{$vo->customer_danwei}}</p>
            <div class="cl"></div>
        </div>
        @endforeach
    </div>
    <!-- loading 小圆圈 -->
    <div class="z2_loading-bg" style="width:100%;height:100%;background:rgba(255,255,255,0.6);position:fixed;;left:0;top:0;">
        <img src="{{asset('images/loading1.gif')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <!-- loadning对号 -->
    <div class="duihao" style="width:100%;height:100%;position:fixed;;left:0;top:0;display:none;">
        <img src="{{asset('images/duihao.png')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
     <!-- 提示信息 --> 
    <p id="tishi" style="display:none;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;width:94%;height:8vw;line-height:8vw;color:#fff;font-size:1.6rem;text-align:center;background:rgba(0,0,0,0.5);border-radius:4px;"></p>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('js/fastclick.min.js')}}"></script>
</body>
    <script src="{{asset('js/LCalendar.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/index.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
    $(function () {
        FastClick.attach(document.body);
    });
    // 执行客户关怀信息发送
    $(function () {
        $("#shengri").click(function(){
            $(".z2_loading-bg").show();
            var id=$("#shengri").next().val();
            $.ajax({
                url:"{{url('kehushengri')}}",
                type:'get', //GET
                async:false,    //或false,是否异步
                data:{'id':id},
                dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                success:function(data){ 
                    if(data=="yuebuzu"){
                        $(".z2_loading-bg").hide();
                        $("#tishi").html('余额不足！');
                        $("#tishi").stop(true, true).fadeIn('fast');
                        $("#tishi").fadeOut(2000);
                    }else if(data=="pinfan"){
                        $(".z2_loading-bg").hide();
                        $("#tishi").html('发送频繁 请稍后尝试');
                        $("#tishi").stop(true, true).fadeIn('fast');
                        $("#tishi").fadeOut(2000);
                        window.location.reload();
                    }else if(data=="shibai"){
                        $(".z2_loading-bg").hide();
                        $("#tishi").html('发送失败');
                        $("#tishi").stop(true, true).fadeIn('fast');
                        $("#tishi").fadeOut(2000);
                        window.location.reload();
                    }else if(data=="success"){
                        $(".z2_loading-bg").hide();
                        $("#tishi").html('发送成功');
                        $("#tishi").stop(true, true).fadeIn('fast');
                        $("#tishi").fadeOut(2000);
                        window.location.reload();
                    }
                }, 
            })
        })
    });
    window.onload = function (event) {
        location.hash = 'khghlb1';
        $("#khghlb1").show();
        $("#khghlb2").hide();
        $(".z2_loading-bg").hide();
    }
    $(window).on('hashchange', function (e) {
        var id = location.hash.substr(1);
        $("#" + id).show()

        if (id == "khghlb1") {
            $("#khlb1").show();
            $("#khlb2").hide();
            $('.khghlb_sx').show();
            $('.ym-tit').html('客户关怀');
        } 
    })
    
    </script>
</html>